package io;

import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

public class PWDemo02 {
    public static void main(String[] args) throws FileNotFoundException {

        PrintWriter pw=new PrintWriter("note.txt");
        Scanner scan=new Scanner(System.in);
        while (true) {
            System.out.println("请输入要做的事，写exit退出");
            String line=scan.nextLine();
            if("exit".equals(line)){
                break;
            }else {
                pw.println(line);
                pw.flush();
            }
        }
        System.out.println("退出成功");
        pw.close();
    }
}
